<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/myblog/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/myblog/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/myblog/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/myblog/images/logo.svg" color="#222">

<link rel="stylesheet" href="/myblog/css/main.css">


<link rel="stylesheet" href="/myblog/lib/font-awesome/css/all.min.css">
  <link rel="stylesheet" href="/myblog/lib/pace/pace-theme-minimal.min.css">
  <script src="/myblog/lib/pace/pace.min.js"></script>

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"gao-qianwei.gitee.io","root":"/myblog/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="学校演讲比赛&amp;ensp;&amp;ensp;&amp;ensp;&amp;ensp;1）某市举行一场演讲比赛，共有24个人参加，按参加顺序设置参赛号。比赛共三轮，前两轮为淘汰赛，第三轮为决赛。">
<meta property="og:type" content="article">
<meta property="og:title" content="STL_综合案例">
<meta property="og:url" content="https://gao-qianwei.gitee.io/myblog/2021/05/07/STL%EF%BC%9A%E7%BB%BC%E5%90%88%E6%A1%88%E4%BE%8B/index.html">
<meta property="og:site_name" content="学无止境">
<meta property="og:description" content="学校演讲比赛&amp;ensp;&amp;ensp;&amp;ensp;&amp;ensp;1）某市举行一场演讲比赛，共有24个人参加，按参加顺序设置参赛号。比赛共三轮，前两轮为淘汰赛，第三轮为决赛。">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2021-05-07T13:33:44.710Z">
<meta property="article:modified_time" content="2021-05-07T13:13:15.757Z">
<meta property="article:author" content="高乾威">
<meta property="article:tag" content="C++">
<meta property="article:tag" content="STL">
<meta property="article:tag" content="STL案例">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://gao-qianwei.gitee.io/myblog/2021/05/07/STL%EF%BC%9A%E7%BB%BC%E5%90%88%E6%A1%88%E4%BE%8B/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>STL_综合案例 | 学无止境</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/myblog/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">学无止境</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/myblog/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/myblog/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/myblog/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/myblog/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/myblog/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
        <li class="menu-item menu-item-links">

    <a href="/myblog/links/" rel="section"><i class="fa fa-link fa-fw"></i>友链</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://gao-qianwei.gitee.io/myblog/2021/05/07/STL%EF%BC%9A%E7%BB%BC%E5%90%88%E6%A1%88%E4%BE%8B/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/myblog/images/avatar.png">
      <meta itemprop="name" content="高乾威">
      <meta itemprop="description" content="报我楼成秋望月，把君诗读夜回灯">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          STL_综合案例
        </h1>

        <div class="post-meta">

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2021-05-07 21:33:44 / 修改时间：21:13:15" itemprop="dateCreated datePublished" datetime="2021-05-07T21:33:44+08:00">2021-05-07</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/myblog/categories/C/" itemprop="url" rel="index"><span itemprop="name">C++</span></a>
                </span>
                  ，
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/myblog/categories/C/STL/" itemprop="url" rel="index"><span itemprop="name">STL</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>
            <span class="post-meta-divider">|</span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h3 id="学校演讲比赛"><a href="#学校演讲比赛" class="headerlink" title="学校演讲比赛"></a>学校演讲比赛</h3><p>&ensp;&ensp;&ensp;&ensp;1）某市举行一场演讲比赛，共有24个人参加，按参加顺序设置参赛号。比赛共三轮，前两轮为淘汰赛，第三轮为决赛。</p>
<span id="more"></span>

<p>&ensp;&ensp;&ensp;&ensp;2）比赛方式：分组比赛<br>&ensp;&ensp;&ensp;&ensp;    第一轮分为4个小组，根据参赛号顺序依次划分，比如100-105为一组，106-111为第二组，依次类推，每组6个人，每人分别按参赛号顺序演讲。<br>当小组演讲完后，淘汰组内排名最后的三个选手，然后继续下一个小组的比赛。<br>    &ensp;&ensp;&ensp;&ensp;第二轮分为2个小组，每组6人，每个人分别按参赛号顺序演讲。当小组完后，淘汰组内排名最后的三个选手，然后继续下一个小组的比赛。<br>    &ensp;&ensp;&ensp;&ensp;第三轮只剩下6个人，本轮为赛决，选出前三名。<br>    &ensp;&ensp;&ensp;&ensp;选手每次要随机分组，进行比赛。<br>&ensp;&ensp;&ensp;&ensp;3）比赛评分：10个评委打分，去除最低、最高分，求平均分<br>    &ensp;&ensp;&ensp;&ensp;每个选手演讲完由10个评委分别打分。该选手的最终得分是去掉一个最高分和一个最低分，求得剩下的8个成绩的平均分。选手的名次按得分降序排列，<br>若得分一样，按参赛号升序排名。</p>
<p>&ensp;&ensp;&ensp;&ensp;用STL编程，求解一下问题</p>
<ol>
<li>请打印出所有选手的名字与参赛号，并以参赛号的升序排列。</li>
<li>打印每一轮比赛前，分组情况</li>
<li>打印每一轮比赛后，小组晋级名单</li>
<li>打印决赛前三名，选手名称、成绩。</li>
</ol>
<h3 id="main-cpp文件"><a href="#main-cpp文件" class="headerlink" title="main.cpp文件"></a>main.cpp文件</h3><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&quot;manager.h&quot;</span></span></span><br><span class="line"><span class="keyword">using</span> <span class="keyword">namespace</span> std;</span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">(<span class="keyword">void</span>)</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">	Manager m;</span><br><span class="line">	m.<span class="built_in">show</span>();</span><br><span class="line">	<span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h3 id="Speaker-h文件"><a href="#Speaker-h文件" class="headerlink" title="Speaker.h文件"></a>Speaker.h文件</h3><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">pragma</span> once</span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;string&gt;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;vector&gt;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;iostream&gt;</span></span></span><br><span class="line"><span class="keyword">using</span> <span class="keyword">namespace</span> std;</span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Speaker</span></span></span><br><span class="line"><span class="class">&#123;</span></span><br><span class="line"><span class="keyword">public</span>:</span><br><span class="line">	<span class="function"><span class="keyword">void</span> <span class="title">setName</span><span class="params">(string s)</span></span>;</span><br><span class="line">	<span class="function">string <span class="title">getName</span><span class="params">()</span></span>;</span><br><span class="line">	<span class="function"><span class="keyword">void</span> <span class="title">setScore</span><span class="params">(<span class="keyword">int</span> n)</span></span>;</span><br><span class="line">	<span class="function"><span class="keyword">int</span> <span class="title">getScore</span><span class="params">(<span class="keyword">int</span> n)</span></span>;</span><br><span class="line">	<span class="function"><span class="keyword">void</span> <span class="title">setNumber</span><span class="params">(<span class="keyword">int</span> n)</span></span>;</span><br><span class="line">	<span class="function"><span class="keyword">int</span> <span class="title">getNumber</span><span class="params">()</span></span>;</span><br><span class="line"><span class="keyword">private</span>:</span><br><span class="line">	string name;</span><br><span class="line">	<span class="keyword">int</span> number;</span><br><span class="line">	vector&lt;<span class="keyword">int</span>&gt;scores;</span><br><span class="line">&#125;;</span><br></pre></td></tr></table></figure>



<h3 id="Speaker-cpp文件"><a href="#Speaker-cpp文件" class="headerlink" title="Speaker.cpp文件"></a>Speaker.cpp文件</h3><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&quot;Speaker.h&quot;</span></span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">Speaker::setName</span><span class="params">(string s)</span> </span>&#123;</span><br><span class="line">	<span class="keyword">this</span>-&gt;name = s;</span><br><span class="line">&#125;</span><br><span class="line"><span class="function">string <span class="title">Speaker::getName</span><span class="params">()</span> </span>&#123;</span><br><span class="line">	<span class="keyword">return</span> <span class="keyword">this</span>-&gt;name;</span><br><span class="line">&#125;</span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">Speaker::setScore</span><span class="params">(<span class="keyword">int</span> n)</span> </span>&#123;<span class="comment">//n是第n+1次成绩</span></span><br><span class="line">	<span class="keyword">this</span>-&gt;scores.<span class="built_in">push_back</span>(n);</span><br><span class="line">&#125;</span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">Speaker::getScore</span><span class="params">(<span class="keyword">int</span> n)</span> </span>&#123;</span><br><span class="line">	<span class="keyword">if</span> (n &lt; <span class="number">0</span> || n&gt;<span class="number">2</span>)</span><br><span class="line">		cout &lt;&lt; <span class="string">&quot;error&quot;</span>;</span><br><span class="line">	<span class="keyword">return</span> <span class="keyword">this</span>-&gt;scores[n];</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">Speaker::setNumber</span><span class="params">(<span class="keyword">int</span> n)</span> </span>&#123;</span><br><span class="line">	<span class="keyword">this</span>-&gt;number = n;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">Speaker::getNumber</span><span class="params">()</span> </span>&#123;</span><br><span class="line">	<span class="keyword">return</span> <span class="keyword">this</span>-&gt;number;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>



<h3 id="Manager-h文件"><a href="#Manager-h文件" class="headerlink" title="Manager.h文件"></a>Manager.h文件</h3><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">pragma</span> once</span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">define</span> SPEAKER_NUMBER 24</span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;string&gt;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;vector&gt;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;map&gt;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;iostream&gt;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;algorithm&gt;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;time.h&gt;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;deque&gt;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;functional&gt;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&quot;Speaker.h&quot;</span></span></span><br><span class="line"><span class="keyword">using</span> <span class="keyword">namespace</span> std;</span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Manager</span></span></span><br><span class="line"><span class="class">&#123;</span></span><br><span class="line"><span class="keyword">public</span>:</span><br><span class="line">	<span class="function"><span class="keyword">void</span> <span class="title">create_speaker</span><span class="params">()</span></span>;</span><br><span class="line">	<span class="function"><span class="keyword">void</span> <span class="title">divid_speaker</span><span class="params">()</span></span>;</span><br><span class="line">	<span class="function"><span class="keyword">void</span> <span class="title">first_game</span><span class="params">()</span></span>;</span><br><span class="line">	<span class="function"><span class="keyword">void</span> <span class="title">second_game</span><span class="params">()</span></span>;</span><br><span class="line">	<span class="function"><span class="keyword">void</span> <span class="title">final_game</span><span class="params">()</span></span>;</span><br><span class="line">	<span class="function"><span class="keyword">void</span> <span class="title">show</span><span class="params">()</span></span>;</span><br><span class="line"><span class="keyword">private</span>:</span><br><span class="line">	vector&lt;Speaker&gt; first_vector;</span><br><span class="line">	vector&lt;Speaker&gt; second_vector;</span><br><span class="line">	vector&lt;Speaker&gt; third_vector;</span><br><span class="line">	multimap&lt;<span class="keyword">int</span>,Speaker&gt; first_groups;</span><br><span class="line">	multimap&lt;<span class="keyword">int</span>, Speaker&gt; second_groups;</span><br><span class="line">	multimap&lt;<span class="keyword">int</span>, Speaker&gt; third_groups;</span><br><span class="line">&#125;;</span><br><span class="line"></span><br></pre></td></tr></table></figure>



<h3 id="Manager-cpp文件"><a href="#Manager-cpp文件" class="headerlink" title="Manager.cpp文件"></a>Manager.cpp文件</h3><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&quot;Manager.h&quot;</span></span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">get_avg_score</span><span class="params">()</span> </span>&#123;</span><br><span class="line">	deque&lt;<span class="keyword">int</span>&gt;score_list;</span><br><span class="line">	<span class="keyword">for</span> (<span class="keyword">int</span> i = <span class="number">0</span>; i &lt; <span class="number">10</span>; i++) &#123;</span><br><span class="line">		<span class="keyword">int</span> score = <span class="built_in">rand</span>() % <span class="number">61</span> + <span class="number">40</span>;</span><br><span class="line">		score_list.<span class="built_in">push_back</span>(score);</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="built_in">sort</span>(score_list.<span class="built_in">begin</span>(), score_list.<span class="built_in">end</span>());</span><br><span class="line">	score_list.<span class="built_in">pop_back</span>();</span><br><span class="line">	score_list.<span class="built_in">pop_front</span>();</span><br><span class="line">	<span class="keyword">int</span> total_score = <span class="number">0</span>;</span><br><span class="line">	<span class="keyword">for</span> (deque&lt;<span class="keyword">int</span>&gt;::iterator it = score_list.<span class="built_in">begin</span>(); it != score_list.<span class="built_in">end</span>(); it++) &#123;</span><br><span class="line">		total_score += (*it);</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="keyword">return</span> total_score / score_list.<span class="built_in">size</span>();</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">print_info_after_game</span><span class="params">(multimap&lt;<span class="keyword">int</span>, Speaker&gt;::iterator p,<span class="keyword">int</span> n)</span> </span>&#123;</span><br><span class="line">	cout &lt;&lt; <span class="string">&quot;姓名:&quot;</span> &lt;&lt; (*p).second.<span class="built_in">getName</span>()</span><br><span class="line">		&lt;&lt; <span class="string">&quot;   编号：&quot;</span> &lt;&lt; (*p).second.<span class="built_in">getNumber</span>()</span><br><span class="line">		&lt;&lt; <span class="string">&quot;   组号：&quot;</span> &lt;&lt; (*p).first</span><br><span class="line">		&lt;&lt; <span class="string">&quot;   分数：&quot;</span> &lt;&lt; (*p).second.<span class="built_in">getScore</span>(n)</span><br><span class="line">		&lt;&lt; endl;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">divide_and_print</span><span class="params">(vector&lt;Speaker&gt; &amp;v, multimap&lt;<span class="keyword">int</span>, Speaker&gt; &amp;m)</span> </span>&#123;</span><br><span class="line">	<span class="keyword">int</span> flag = <span class="number">1</span>;</span><br><span class="line">	<span class="keyword">for</span> (vector&lt;Speaker&gt;::iterator it = v.<span class="built_in">begin</span>(); it != v.<span class="built_in">end</span>(); ) &#123;</span><br><span class="line">		<span class="keyword">for</span> (<span class="keyword">int</span> j = <span class="number">0</span>; j &lt; <span class="number">6</span>; j++, it++) &#123;</span><br><span class="line">			m.<span class="built_in">insert</span>(<span class="built_in">make_pair</span>(flag, *it));</span><br><span class="line">		&#125;</span><br><span class="line">		flag++;</span><br><span class="line">	&#125;</span><br><span class="line">	cout &lt;&lt; <span class="string">&quot;第二次分组：&quot;</span> &lt;&lt; endl;</span><br><span class="line">	<span class="keyword">for</span> (multimap&lt;<span class="keyword">int</span>, Speaker&gt;::iterator p = m.<span class="built_in">begin</span>(); p != m.<span class="built_in">end</span>(); p++) &#123;</span><br><span class="line">		cout &lt;&lt; <span class="string">&quot;姓名:&quot;</span> &lt;&lt; (*p).second.<span class="built_in">getName</span>() &lt;&lt; <span class="string">&quot;   编号：&quot;</span> &lt;&lt; (*p).second.<span class="built_in">getNumber</span>() &lt;&lt; <span class="string">&quot;   组号：&quot;</span> &lt;&lt; (*p).first &lt;&lt; endl;</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">print_info_after_game</span><span class="params">(multimap&lt;<span class="keyword">int</span>, Speaker&gt; &amp;m,vector&lt;Speaker&gt; &amp;v)</span> </span>&#123;	</span><br><span class="line">	<span class="keyword">for</span> (multimap&lt;<span class="keyword">int</span>, Speaker&gt;::iterator p = m.<span class="built_in">begin</span>(); p != m.<span class="built_in">end</span>(); p++) &#123;</span><br><span class="line">		<span class="built_in">print_info_after_game</span>(p, <span class="number">0</span>);</span><br><span class="line">		v.<span class="built_in">push_back</span>((*p).second);</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">Manager::create_speaker</span><span class="params">()</span> </span>&#123;</span><br><span class="line">	string name_seed = <span class="string">&quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;</span>;</span><br><span class="line">	<span class="keyword">for</span> (<span class="keyword">int</span> i = <span class="number">0</span>; i &lt; SPEAKER_NUMBER; i++) &#123;</span><br><span class="line"></span><br><span class="line">		Speaker speaker;</span><br><span class="line">		string tmp = name_seed.<span class="built_in">substr</span>(i, <span class="number">1</span>);</span><br><span class="line">		speaker.<span class="built_in">setName</span>(<span class="string">&quot;选手&quot;</span> + tmp);</span><br><span class="line">		<span class="keyword">this</span>-&gt;first_vector.<span class="built_in">push_back</span>(speaker);</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">bool</span> <span class="title">compare</span><span class="params">(Speaker &amp;s1,Speaker &amp;s2)</span> </span>&#123;</span><br><span class="line">	<span class="keyword">return</span> s1.<span class="built_in">getNumber</span>() &lt; s2.<span class="built_in">getNumber</span>();</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">Manager::divid_speaker</span><span class="params">()</span> </span>&#123;</span><br><span class="line">	<span class="comment">//随机分配编号</span></span><br><span class="line">	<span class="built_in">random_shuffle</span>(<span class="keyword">this</span>-&gt;first_vector.<span class="built_in">begin</span>(), <span class="keyword">this</span>-&gt;first_vector.<span class="built_in">end</span>()); </span><br><span class="line">	<span class="keyword">int</span> ij = <span class="number">0</span>;</span><br><span class="line">	<span class="keyword">for</span> (vector&lt;Speaker&gt;::iterator it = <span class="keyword">this</span>-&gt;first_vector.<span class="built_in">begin</span>(); it != <span class="keyword">this</span>-&gt;first_vector.<span class="built_in">end</span>(); ij++,it++) &#123;</span><br><span class="line">		<span class="keyword">this</span>-&gt;first_vector[ij].<span class="built_in">setNumber</span>(ij+<span class="number">100</span>);</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="built_in">sort</span>(<span class="keyword">this</span>-&gt;first_vector.<span class="built_in">begin</span>(),<span class="keyword">this</span>-&gt;first_vector.<span class="built_in">end</span>(),compare);</span><br><span class="line">	<span class="built_in">divide_and_print</span>(<span class="keyword">this</span>-&gt;first_vector, <span class="keyword">this</span>-&gt;first_groups);	</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">bool</span> <span class="title">compare_score</span><span class="params">(Speaker&amp; s1, Speaker&amp; s2)</span> </span>&#123;</span><br><span class="line">	<span class="keyword">return</span> s1.<span class="built_in">getScore</span>(<span class="number">0</span>) &gt; s2.<span class="built_in">getScore</span>(<span class="number">0</span>);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">Manager::first_game</span><span class="params">()</span> </span>&#123;</span><br><span class="line">	<span class="built_in">srand</span>(<span class="built_in">time</span>(<span class="literal">nullptr</span>));</span><br><span class="line">	<span class="keyword">for</span> (multimap&lt;<span class="keyword">int</span>, Speaker&gt;::iterator p = <span class="keyword">this</span>-&gt;first_groups.<span class="built_in">begin</span>(); p != <span class="keyword">this</span>-&gt;first_groups.<span class="built_in">end</span>(); p++) &#123;</span><br><span class="line">		<span class="comment">//cout &lt;&lt; &quot;姓名:&quot; &lt;&lt; (*p).second.getName() &lt;&lt; &quot;   编号：&quot; &lt;&lt; (*p).second.getNumber() &lt;&lt; &quot;   组号：&quot; &lt;&lt; (*p).first &lt;&lt; endl;</span></span><br><span class="line">		<span class="keyword">int</span> avg_score = <span class="built_in">get_avg_score</span>();</span><br><span class="line">		(*p).second.<span class="built_in">setScore</span>(avg_score);</span><br><span class="line">	&#125;</span><br><span class="line">	cout &lt;&lt; <span class="string">&quot;第一次比赛后：&quot;</span> &lt;&lt; endl;</span><br><span class="line">	<span class="built_in">print_info_after_game</span>(<span class="keyword">this</span>-&gt;first_groups, <span class="keyword">this</span>-&gt;second_vector);</span><br><span class="line">		</span><br><span class="line">	<span class="comment">//先按分数排序，再去掉后一半，再按编号排序</span></span><br><span class="line">	<span class="built_in">sort</span>(<span class="keyword">this</span>-&gt;second_vector.<span class="built_in">begin</span>(),<span class="keyword">this</span>-&gt;second_vector.<span class="built_in">end</span>(),compare_score);</span><br><span class="line">	<span class="keyword">this</span>-&gt;second_vector.<span class="built_in">erase</span>(<span class="keyword">this</span>-&gt;second_vector.<span class="built_in">begin</span>()+<span class="number">12</span>,<span class="keyword">this</span>-&gt;second_vector.<span class="built_in">end</span>());</span><br><span class="line">	<span class="built_in">sort</span>(<span class="keyword">this</span>-&gt;second_vector.<span class="built_in">begin</span>(), <span class="keyword">this</span>-&gt;second_vector.<span class="built_in">end</span>(), compare);</span><br><span class="line">	cout &lt;&lt; <span class="string">&quot;第一次比赛后晋级名单:&quot;</span> &lt;&lt; endl;</span><br><span class="line">	<span class="keyword">for</span> (vector&lt;Speaker&gt;::iterator it = <span class="keyword">this</span>-&gt;second_vector.<span class="built_in">begin</span>(); it != <span class="keyword">this</span>-&gt;second_vector.<span class="built_in">end</span>(); it++) &#123;</span><br><span class="line">		cout &lt;&lt; (*it).<span class="built_in">getName</span>() &lt;&lt; <span class="string">&quot;  &quot;</span>&lt;&lt;(*it).<span class="built_in">getNumber</span>()&lt;&lt;endl;</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="built_in">divide_and_print</span>(<span class="keyword">this</span>-&gt;second_vector, <span class="keyword">this</span>-&gt;second_groups);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">bool</span> <span class="title">compare_score_second</span><span class="params">(Speaker&amp; s1, Speaker&amp; s2)</span> </span>&#123;</span><br><span class="line">	<span class="keyword">return</span> s1.<span class="built_in">getScore</span>(<span class="number">1</span>) &gt; s2.<span class="built_in">getScore</span>(<span class="number">1</span>);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">Manager::second_game</span><span class="params">()</span> </span>&#123;</span><br><span class="line">	<span class="built_in">srand</span>(<span class="built_in">time</span>(<span class="literal">nullptr</span>));</span><br><span class="line">	<span class="keyword">for</span> (multimap&lt;<span class="keyword">int</span>, Speaker&gt;::iterator p = <span class="keyword">this</span>-&gt;second_groups.<span class="built_in">begin</span>(); p != <span class="keyword">this</span>-&gt;second_groups.<span class="built_in">end</span>(); p++) &#123;</span><br><span class="line">		<span class="comment">//cout &lt;&lt; &quot;姓名:&quot; &lt;&lt; (*p).second.getName() &lt;&lt; &quot;   编号：&quot; &lt;&lt; (*p).second.getNumber() &lt;&lt; &quot;   组号：&quot; &lt;&lt; (*p).first &lt;&lt; endl;</span></span><br><span class="line">		<span class="keyword">int</span> avg_score = <span class="built_in">get_avg_score</span>();</span><br><span class="line">		(*p).second.<span class="built_in">setScore</span>(avg_score);</span><br><span class="line">	&#125;</span><br><span class="line">	cout &lt;&lt; <span class="string">&quot;第二次比赛后：&quot;</span> &lt;&lt; endl;</span><br><span class="line">	<span class="built_in">print_info_after_game</span>(<span class="keyword">this</span>-&gt;second_groups, <span class="keyword">this</span>-&gt;third_vector);</span><br><span class="line"></span><br><span class="line">	<span class="comment">//先按分数排序，再去掉后一半，再按编号排序</span></span><br><span class="line">	<span class="built_in">sort</span>(<span class="keyword">this</span>-&gt;third_vector.<span class="built_in">begin</span>(), <span class="keyword">this</span>-&gt;third_vector.<span class="built_in">end</span>(), compare_score_second);</span><br><span class="line">	<span class="keyword">this</span>-&gt;third_vector.<span class="built_in">erase</span>(<span class="keyword">this</span>-&gt;third_vector.<span class="built_in">begin</span>() + <span class="number">6</span>, <span class="keyword">this</span>-&gt;third_vector.<span class="built_in">end</span>());</span><br><span class="line">	<span class="built_in">sort</span>(<span class="keyword">this</span>-&gt;third_vector.<span class="built_in">begin</span>(), <span class="keyword">this</span>-&gt;third_vector.<span class="built_in">end</span>(), compare);</span><br><span class="line">	cout &lt;&lt; <span class="string">&quot;第二次比赛后晋级名单:&quot;</span> &lt;&lt; endl;</span><br><span class="line">	<span class="keyword">for</span> (vector&lt;Speaker&gt;::iterator it = <span class="keyword">this</span>-&gt;third_vector.<span class="built_in">begin</span>(); it != <span class="keyword">this</span>-&gt;third_vector.<span class="built_in">end</span>(); it++) &#123;</span><br><span class="line">		cout &lt;&lt; (*it).<span class="built_in">getName</span>() &lt;&lt; <span class="string">&quot;  &quot;</span> &lt;&lt; (*it).<span class="built_in">getNumber</span>() &lt;&lt; endl;</span><br><span class="line">	&#125;	</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">bool</span> <span class="title">compare_score_third</span><span class="params">(Speaker&amp; s1, Speaker&amp; s2)</span> </span>&#123;</span><br><span class="line">	<span class="keyword">return</span> s1.<span class="built_in">getScore</span>(<span class="number">2</span>) &gt; s2.<span class="built_in">getScore</span>(<span class="number">2</span>);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">Manager::final_game</span><span class="params">()</span> </span>&#123;</span><br><span class="line">	<span class="built_in">srand</span>(<span class="built_in">time</span>(<span class="literal">nullptr</span>));</span><br><span class="line">	<span class="keyword">for</span> (vector&lt;Speaker&gt;::iterator p = <span class="keyword">this</span>-&gt;third_vector.<span class="built_in">begin</span>(); p != <span class="keyword">this</span>-&gt;third_vector.<span class="built_in">end</span>(); p++) &#123;</span><br><span class="line">		<span class="keyword">int</span> avg_score = <span class="built_in">get_avg_score</span>();</span><br><span class="line">		(*p).<span class="built_in">setScore</span>(avg_score);</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	cout &lt;&lt; <span class="string">&quot;第三次比赛后：&quot;</span> &lt;&lt; endl;</span><br><span class="line">	<span class="keyword">for</span> (vector&lt;Speaker&gt;::iterator p = <span class="keyword">this</span>-&gt;third_vector.<span class="built_in">begin</span>(); p != <span class="keyword">this</span>-&gt;third_vector.<span class="built_in">end</span>(); p++) &#123;</span><br><span class="line">		cout &lt;&lt; <span class="string">&quot;姓名:&quot;</span> &lt;&lt; (*p).<span class="built_in">getName</span>()&lt;&lt; <span class="string">&quot;   编号：&quot;</span> &lt;&lt; (*p).<span class="built_in">getNumber</span>()&lt;&lt; <span class="string">&quot;   分数：&quot;</span> &lt;&lt; (*p).<span class="built_in">getScore</span>(<span class="number">2</span>)	&lt;&lt; endl;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="comment">//先按分数排序，再去掉后一半，再按编号排序</span></span><br><span class="line">	<span class="built_in">sort</span>(<span class="keyword">this</span>-&gt;third_vector.<span class="built_in">begin</span>(), <span class="keyword">this</span>-&gt;third_vector.<span class="built_in">end</span>(), compare_score_third);</span><br><span class="line">	<span class="keyword">this</span>-&gt;third_vector.<span class="built_in">erase</span>(<span class="keyword">this</span>-&gt;third_vector.<span class="built_in">begin</span>() + <span class="number">3</span>, <span class="keyword">this</span>-&gt;third_vector.<span class="built_in">end</span>());</span><br><span class="line">	cout &lt;&lt; <span class="string">&quot;前三名名单:&quot;</span> &lt;&lt; endl;</span><br><span class="line">	<span class="keyword">for</span> (vector&lt;Speaker&gt;::iterator it = <span class="keyword">this</span>-&gt;third_vector.<span class="built_in">begin</span>(); it != <span class="keyword">this</span>-&gt;third_vector.<span class="built_in">end</span>(); it++) &#123;</span><br><span class="line">		cout &lt;&lt; <span class="string">&quot;姓名:&quot;</span> &lt;&lt; (*it).<span class="built_in">getName</span>() &lt;&lt; <span class="string">&quot;   编号：&quot;</span>&lt;&lt; (*it).<span class="built_in">getNumber</span>() &lt;&lt; <span class="string">&quot;   分数：&quot;</span> &lt;&lt;(*it).<span class="built_in">getScore</span>(<span class="number">2</span>)&lt;&lt; endl;</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">Manager::show</span><span class="params">()</span> </span>&#123;</span><br><span class="line">	<span class="keyword">this</span>-&gt;<span class="built_in">create_speaker</span>();</span><br><span class="line">	<span class="keyword">this</span>-&gt;<span class="built_in">divid_speaker</span>();</span><br><span class="line">	<span class="keyword">this</span>-&gt;<span class="built_in">first_game</span>();</span><br><span class="line">	<span class="keyword">this</span>-&gt;<span class="built_in">second_game</span>();</span><br><span class="line">	<span class="keyword">this</span>-&gt;<span class="built_in">final_game</span>();</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>


    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/myblog/tags/C/" rel="tag"># C++</a>
              <a href="/myblog/tags/STL/" rel="tag"># STL</a>
              <a href="/myblog/tags/STL%E6%A1%88%E4%BE%8B/" rel="tag"># STL案例</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/myblog/2021/05/07/STL%EF%BC%9A%E5%91%98%E5%B7%A5%E5%88%86%E7%BB%84%E6%A1%88%E4%BE%8B/" rel="prev" title="STL_员工分组案例">
      <i class="fa fa-chevron-left"></i> STL_员工分组案例
    </a></div>
      <div class="post-nav-item">
    <a href="/myblog/2021/05/09/%E7%AE%97%E6%B3%95%E4%B8%8E%E6%95%B0%E5%AD%A6%EF%BC%9A%E6%8E%92%E5%88%97/" rel="next" title="排列组合之排列">
      排列组合之排列 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%AD%A6%E6%A0%A1%E6%BC%94%E8%AE%B2%E6%AF%94%E8%B5%9B"><span class="nav-text">学校演讲比赛</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#main-cpp%E6%96%87%E4%BB%B6"><span class="nav-text">main.cpp文件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Speaker-h%E6%96%87%E4%BB%B6"><span class="nav-text">Speaker.h文件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Speaker-cpp%E6%96%87%E4%BB%B6"><span class="nav-text">Speaker.cpp文件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Manager-h%E6%96%87%E4%BB%B6"><span class="nav-text">Manager.h文件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Manager-cpp%E6%96%87%E4%BB%B6"><span class="nav-text">Manager.cpp文件</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="高乾威"
      src="/myblog/images/avatar.png">
  <p class="site-author-name" itemprop="name">高乾威</p>
  <div class="site-description" itemprop="description">报我楼成秋望月，把君诗读夜回灯</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/myblog/archives/">
        
          <span class="site-state-item-count">91</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/myblog/categories/">
          
        <span class="site-state-item-count">27</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/myblog/tags/">
          
        <span class="site-state-item-count">59</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="http://github.com/GaoQianwei" title="GitHub → http:&#x2F;&#x2F;github.com&#x2F;GaoQianwei" rel="noopener" target="_blank">GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:2966807184@qq.com" title="E-Mail → mailto:2966807184@qq.com" rel="noopener" target="_blank">E-Mail</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://www.zhihu.com/people/xue-wu-zhi-jing-75-22" title="知乎 → https:&#x2F;&#x2F;www.zhihu.com&#x2F;people&#x2F;xue-wu-zhi-jing-75-22" rel="noopener" target="_blank">知乎</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://blog.csdn.net/weixin_45341339" title="CSDN → https:&#x2F;&#x2F;blog.csdn.net&#x2F;weixin_45341339" rel="noopener" target="_blank">CSDN</a>
      </span>
  </div>



      </div><div>
  <canvas id="canvasDiyBlock" style="width:60%;">当前浏览器不支持canvas，请更换浏览器后再试</canvas>
<script src="/myblog/js/custom/clock.js"></script>

</div>


    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 2021-04 到 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">高乾威</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

<span class="post-meta-divider">|</span>

<div class="theme-info">
  <div class="powered-by"></div>
  <span class="post-count">全站共 117.2k 字</span>
</div>

<span class="post-meta-divider">|</span>
        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/myblog/lib/anime.min.js"></script>
  <script src="/myblog/lib/velocity/velocity.min.js"></script>
  <script src="/myblog/lib/velocity/velocity.ui.min.js"></script>

<script src="/myblog/js/utils.js"></script>

<script src="/myblog/js/motion.js"></script>


<script src="/myblog/js/schemes/pisces.js"></script>


<script src="/myblog/js/next-boot.js"></script>


  <script defer src="/myblog/lib/three/three.min.js"></script>
    <script defer src="/myblog/lib/three/canvas_lines.min.js"></script>


  




  
<script src="/myblog/js/local-search.js"></script>













  

  

</body>
</html>
